<script type="text/javascript">
function delete_comments() {
    var ids = '';
    $("input[@type=checkbox]:checked").each(function() {
        if (this.value != '') {
              ids = ids + this.value + '|';
        }
    });
    if (ids == '') {
        show_noticemessage('<?php __e('No conversations selected.'); ?>');
    } else {
        $.get('<?php echo $html->admin_url('/comments/ajax_delete_comments/'); ?>'+ ids + '?time=' + time_now(), function(data) {
            window.location.href='<?php echo $html->admin_url('/comments/comments/' . $page . '/'); ?>' + data;
            return true;
        });
    }
}
</script>
<div id="content">
<?php
if (empty($results->results)) {
echo '<span class="new">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;还没有任何评论.</span>';
} else {
?>
 <form id="list">
    <table>
      <tr>
        <td colspan="4" class="tablebar"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td align="left"><span class="tablebar_content"><input value="删除" type="button" onclick="delete_comments();"></span>

            <td align="right"><span class="page_link"><?php echo $results->pagelink; ?></span></td>
          </tr>
        </table></td>
        </tr>

      <tr>
        <th> <input value="" type="checkbox" name="select_all" id="select_all" onclick="mod_allcheckbox_status2('comments_id[]',this.checked);"></th>
        <th> 评论</th>
        <th>时间</th>
        <th>操作</th>
      </tr>
<?php
foreach($results->results as $comment) {
?>
      <tr id="tr_<?php echo $comment->id; ?>">
        <td>
        <input value="<?php echo $comment->id; ?>" type="checkbox" name="comments_id[]" onclick="change_allcheckbox_status('comments_id[]','select_all');"></td>
        <td>
<strong><a class="row-title" href="#"><?php echo $comment->author; ?></a></strong><br>
        <?php echo !empty($comment->author_url) ? $comment->author_url . ' | ' : ''; ?>
        <?php echo $comment->author_email; ?> | <?php echo $comment->author_ip; ?>
   	<p><?php echo $comment->content; ?></p>
   	<p><?php __e('From'); ?> <?php echo get_post_title($comment->post_id); ?> , <?php echo date('Y/m/d H:i:s a', $comment->post_time); ?></p>
   	
   	</td>
        <td> <?php echo date('Y-m-d', $comment->post_time); ?> </td>

        <td> <!--<span class="approve"><a href="#">Approve</a> | </span><span class="unapprove"><a href="#">Unapprove</a> | </span><span class="spam"><a href="#">Edit</a> | </span>--><span class="delete"><?php echo $html->admin_link(__('Delete'), '/comments/delete/' . $comment->id . '?'. $url); ?></span></td>
      </tr>
<?php
}
?>
      <tr>
        <td colspan="4" class="tablebar"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td align="left"><span class="tablebar_content"><input value="删除" type="button" onclick="delete_comments();"></span>
    </td>
        <td align="right"><span class="page_link"><?php echo $results->pagelink; ?></span></td>

          </tr>
        </table></td>
        </tr>
    </table>
  </form>
<?php
}
?>
</div>
